package utility.file;

import java.io.*;

/**
 * 载入文件类
 * @author lit
 * @date 2018/3/14.
 */
public class FileReader {

    public static String loadFile(String filePath){
        String result = "";
        try{
            InputStreamReader isr = new InputStreamReader(FileReader.class.getResourceAsStream(filePath));
            BufferedReader br = new BufferedReader(isr);
            String temp = null;

            while((temp = br.readLine()) != null){
                result += temp;
            }
            isr.close();
            br.close();
        }catch (Exception e){
            e.printStackTrace();
        }
        return result;
    }
}
